package com.yhhvip.goods.service;

import com.yhhvip.goods.dao.UserKeysDao;
import com.yhhvip.goods.entity.UserKeys;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


@Service
public class UserService {
    @Autowired
    private UserKeysDao userKeysDao;
    private static final String PLATFORM_WEB = "Web";
    private static final Logger logger = Logger.getLogger(UserService.class);
    public UserKeys userLoginBykey(String USER_KEY){
        UserKeys userkey;
        userkey=userKeysDao.IsUserKeyByUserKey(USER_KEY);
        if (userkey != null){
        if (userkey.getExpiry().getTime() >System.currentTimeMillis()){
            return  userkey;
        }
        }
        return null;
    }
}
